

function main( json, ui, hh ) {
	
	if( null == json ) throw new Exception("param json is null!");
	
	return createAccount( json );
	
}

function createAccount( p ) {
	
	 var a = new AccountEntity();
	 
	 a.id			= p.id;
	 a.passwd		= p.passwd;
	 a.jsonRoles	= p.jsonRoles;
	 a.tenant		= p.tenant;
	  
	 EntityManager.createAccount( a );
	 
	 return a; 
}

/*
function main( ui, hh ) {
	
	var json = ui.getQueryParameters().getFirst("json");
	
	if( null == json ) throw new Exception("param json is null!");
	
	return createAccount( new JSONObject(json) );
	
}

function createAccount( p ) {
 var a = new AccountEntity();
 
 a.id = p.getString("id");
 a.passwd = p.getString("passwd");
 a.jsonRoles = p.getString("jsonRoles");
 a.tenant = p.getString("tenant");
  
 EntityManager.createAccount( a );
 
 return a; 
}
*/
